package iterator;

import java.util.ArrayList;
import java.util.List;

/**
 * @Author: Doream
 * @Date: 2022/1/30 12:38
 */
public class StudentAggregateImpl implements StudentAggregate{
    List<Student> studentList = new ArrayList<>();
    @Override
    public void addStudet(Student student) {
        studentList.add(student);
    }

    @Override
    public void removeStudent(Student student) {
        studentList.remove(student);
    }

    @Override
    public StudentIterator getStudentIterator() {
        return new StudentIteratorImpl(this.studentList);
    }
}
